package com.hejia.alauda.persistence.mybatis;

import java.util.List;
import java.util.Map;
import com.hejia.alauda.entity.SaleActivity;
import com.hejia.alauda.persistence.BaseMapper;
import org.apache.ibatis.annotations.Update;

/**
 *
 * Created by jimi on 14/12/3.
 */
public interface SaleActivityMapper extends BaseMapper<SaleActivity> {

	/**
	 * 根据条件修改活动状态
	 */
	@Update("update saleactivity set saleactivity.isFinish = true , saleactivity.tag = \"END\" where now() > saleactivity.endTime and saleactivity.isFinish = false")
	public void updateSaleActivityState();

	List<SaleActivity> selectActivity(Map<String, Object> map);

	int selectActivityCount(Map<String, Object> map);
}
